#ifndef RECOGNIZEDEVICE_H
#define RECOGNIZEDEVICE_H

#include <QObject>
#include <QTcpSocket>
#include "device.h"
#include "description.h"
#include <QJsonObject>
#include "../cnn/defectrecognizer.h"


class RecognizeDevice : public Device
{
    Q_OBJECT
public:
    explicit RecognizeDevice(QObject *parent = nullptr);
    ~RecognizeDevice();

private:
    Description*                m_pDescription;
    bool                        m_bUseGPU;
    QString                     m_strModelPath;

public:
    bool                        GetUseGPU(){return m_bUseGPU;}
    QString                     GetModelPath(){return m_strModelPath;}

    void                        SetModePath(QString strPath){m_strModelPath = strPath;}
    void                        SetUseGPU(bool used){m_bUseGPU = used;}

    void                        SetDescription(Description* pDescription){m_pDescription = pDescription;}
    Description*                GetDescription(){return m_pDescription;}

private:
    DefectRecognizer            m_objDefectRecognizer;
    //ORTRecognizer               m_objORTRecognizer;

public:
    virtual Device* clone(Device* pDevice) override;

    virtual void writeXML(QXmlStreamWriter &writer) override;
    virtual void readFromXML(QXmlStreamReader &reader) override;

    virtual int initDevice() override;
    virtual void writeData(const QVariant &data) override;
    virtual void uninitDevice() override;
    virtual QString getClassName() override;
};

#endif // RECOGNIZEDEVICE_H
